import requests

url = 'https://y.qq.com/n/ryqq/player'
# url = 'https://ws6.stream.qqmusic.qq.com/RS02062YwKP90VtMsZ.mp3?guid=3928262692&vkey=F66BF83E6BB63BE3B7ED4C1891F1F4EE504744DDB45AA874257F5AA9BE58AF8786339A379DC4771D4DA258ACF3C31432A6BE472A88EDBB36&uin=3229732932&fromtag=120052'
headers = {
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36 Edg/126.0.0.0'
}
# response = requests.get(url)
# content_type = response.headers['Content-Type']
# print(content_type)
response = requests.get(url, headers=headers)
response.encoding = 'utf-8'
with open('aaa.mp3', 'wb') as f:
    f.write(response.content)
print(response.content)
